package com.feri.rbacsys.mapper;

import com.feri.rbacsys.dto.OrderDetailDto;
import com.feri.rbacsys.dto.OrderDto;
import com.feri.rbacsys.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 24122
* @description 针对表【order】的数据库操作Mapper
* @createDate 2023-03-27 19:36:29
* @Entity com.feri.rbacsys.entity.Order
*/
public interface OrderMapper extends BaseMapper<Order> {
    @Select("select * from t_order o inner join t_receiver r on o.rid=r.id where flag=0")
    @ResultType(OrderDto.class)
      List<OrderDto> selectDtos();
    @Select("select o.*,o.id oid,r.*,r.id rid from t_order o left join  t_receiver r on o.rid=r.id where o.id=#{oid}")
    @ResultType(OrderDetailDto.class)
    OrderDetailDto selectOrderDetailDto(Integer oid);
    void insertBatch(List<Order> list);
}




